package com.zllkj.mm.module.home.fragments;

import android.view.View;

import com.orhanobut.hawk.Hawk;
import com.zllkj.mm.R;
import com.zllkj.mm.base.BaseTitleFragment;
import com.zllkj.mm.common.L;
import com.zllkj.mm.module.UIHelper;
import com.zllkj.mm.module.main.fragments.MineFragment;
import com.zllkj.mm.util.EmptyUtils;

import butterknife.OnClick;


/**
 * Created by leon_ok.
 */

public class SettingFragment_mm extends BaseTitleFragment {


    public static SettingFragment_mm newInstance() {
        return new SettingFragment_mm();
    }

    @Override
    protected int getContentLayoutId() {
        return R.layout.fragment_setting_mm;
    }

    @Override
    protected void initView(View rootView) {
        super.initView(rootView);
        setCommonTitle("设置");
    }


    @Override
    public void onResume() {
        super.onResume();
        if (!EmptyUtils.isEmpty(MineFragment.userInfo)) {
//            tvPhone.setText(MineFragment.userInfo.phone);
//            tvMail.setText(MineFragment.userInfo.email);
//            .setText((EmptyUtils.isEmpty(MineFragment.userInfo.phone) ? "设置" : "修改") + "手机号码");
        }
    }

    @OnClick({R.id.exit,R.id.rl_address_manager,R.id.rl_block_list})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.exit:
                Hawk.delete(L.token);
                UIHelper.showLoginPage(getActivity());
                break;
            case R.id.rl_address_manager:
                addFragment(new MyAddressListFragment());
                break;
            case R.id.rl_block_list:
                addFragment(new BlockListFragment());
                break;
        }
    }


}
